let state = {
  assetsManagement: [],
  skHomeMarket: [],
  currentRow: {},
  skMarketList: []
};
let mutations = {
  skAssets (state, {data}) {
    state.assetsManagement = data;
  },
  skHomeMarket (state, {data}) {
    state.skMarketData = data;
  },
  selectCurrentRow (state, {row}) {
    state.currentRow = row;
  },
  skMarketList (state, {data}) {
    state.skMarketList = data;
  }
};
let actions = {
  sendSkAssets ({commit}, data) {
    commit('skAssets', {data});
  },
  sendMarketData ({commit}, data) {
    commit('skHomeMarket', {data});
  },
  sendCurrentRow ({commit}, row) {
    console.log('sendCurrentRow', row);
    commit('selectCurrentRow', {row});
  },
  sendMarketList ({commit}, data) {
    console.log('sendmarketList', data);
    commit('skMarketList', {data});
  }
};
// const getters = {
//   marKetSelectRow (state) {
//     console.log(state.currentRow, state.skMarketList, 'storeMarket');
//     if (state.currentRow.hasOwnProperty('marketDataNo') && state.skMarketList.length) {
//       let row = state.skMarketList.find((ele) => state.currentRow.marketDataNo === ele.marketDataNo);
//       return row;
//     }
//   }
// };
export default{
  state,
  mutations,
  actions
  // getters
};
